<!-- include tpl=usercp/header title=收货地址 -->
<section class="container">
	<div class="row m-3">
		<div class="col-2">
			<!-- include tpl=usercp/left -->
		</div>
		<div class="col-10">
			<div class="card">
				<div class="card-header">
					收货地址
					<!-- if $total < 30 -->
					<div class="float-end">
						<input type="button" value="添加地址" onclick="$.phpok.open('{url ctrl=usercp func=address_setting/}')" class="btn btn-sm btn-primary" />
					</div>
					<!-- /if -->
				</div>
				<table class="table mb-0">
				<thead>
				<tr>
					<th></th>
					<th>收件人/地址</th>
					<th>联系方式</th>
					<th>默认</th>
					<th style="width:260px">操作</th>
				</tr>
				</thead>
				<!-- loop from=$rslist key=$key value=$value -->
				<tr>
					<td>#{$value.id}</td>
					<td>{$value.fullname}<br />{$value.province}<!-- if $value.province != $value.city -->{$value.city}<!-- /if -->{$value.county}-{$value.address}（{$value.country}）</td>
					<td>{$value.mobile}<!-- if $value.mobile && $value.tel --> / <!-- /if -->{$value.tel}</td>
					<td>
						<!-- if $value.is_default -->
						<input type="button" value="默认地址" disabled class="btn btn-sm btn-danger" />
						<!-- else -->
						<input type="button" value="设为默认" onclick="$.address.set_default('{$value.id}')" class="btn btn-sm btn-light" />
						<!-- /if -->
					</td>
					<td>
						<div class="btn-group">
							<input type="button" value="编辑" onclick="$.phpok.open('{url ctrl=usercp func=address_setting id=$value.id/}')" class="btn btn-sm btn-primary" />
							<input type="button" value="删除" onclick="$.address.del('{$value.id}')" class="btn btn-sm btn-danger" />
						</div>
					</td>
				</tr>
				<!-- /loop -->
				</table>
			</div>
		</div>
	</div>
</section>
<!-- include tpl=usercp/footer -->